package com.example.common.entity;

import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

@Data
@Entity
@Table(name = "h_depart_and_disease")
@IdClass(DepartAndDisease.PrimaryKey.class)
public class DepartAndDisease implements Serializable {

	private static final long serialVersionUID = 2852623508567073847L;
	@Id
	@Column(name = "depart_id_bigint", columnDefinition = "bigint(20)")
	private Long departId;
	@Id
	@Column(name = "disease_id_bigint", columnDefinition = "bigint(20)")
	private Long diseaseId;

	@Data
	static class PrimaryKey implements Serializable {
		private static final long serialVersionUID = 5201481037628187334L;
		private Long departId;
		private Long diseaseId;
	}
}
